package com.sjs.flow.http.exception;

/**
 * @author uto_dev_008
 * @desc
 * @since 2021/11/22 15:42
 * Copyright (c) 2021 南京友拓信息技术有限公司 All rights reserved
 */
public abstract class AbstractApiException extends RuntimeException {

    private final Object data;
    private final int code;

    public AbstractApiException(String message, int code) {
        super(message);
        this.data = null;
        this.code = code;
    }

    public AbstractApiException(String message, int code, Throwable throwable) {
        super(message, throwable);
        this.data = null;
        this.code = code;
    }

    public AbstractApiException(Object data, String message, int code) {
        super(message);
        this.data = data;
        this.code = code;
    }

    public AbstractApiException(Object data, String message, int code, Throwable throwable) {
        super(message, throwable);
        this.data = data;
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public int getCode() {
        return code;
    }

}
